package com.sss.service.impl;

import com.sss.entity.WmStorageArea;
import com.sss.mapper.WmStorageAreaMapper;
import com.sss.service.WmStorageAreaService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
 * 库位表(WmStorageArea)表服务实现类
 *
 * @author makejava
 * @since 2023-12-14 16:55:32
 */
@Service("wmStorageAreaService")
public class WmStorageAreaServiceImpl implements WmStorageAreaService {
    @Autowired
    private WmStorageAreaMapper wmStorageAreaMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param areaId 主键
     * @return 实例对象
     */
    @Override
    public WmStorageArea queryById(Long areaId) {
        return this.wmStorageAreaMapper.queryById(areaId);
    }

    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @Override
    public List<WmStorageArea> queryByPage(Long pageNum) {
        return this.wmStorageAreaMapper.queryAllByLimit();
    }

    /**
     * 新增数据
     *
     * @param wmStorageArea 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(WmStorageArea wmStorageArea) {
        return this.wmStorageAreaMapper.insert(wmStorageArea);
    }

    /**
     * 修改数据
     *
     * @param wmStorageArea 实例对象
     * @return 实例对象
     */
    @Override
    public int update(WmStorageArea wmStorageArea) {
        return this.wmStorageAreaMapper.update(wmStorageArea);
    }

    /**
     * 通过主键删除数据
     *
     * @param areaId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long areaId) {
        return this.wmStorageAreaMapper.deleteById(areaId) > 0;
    }
}
